<!-- /* Description for file.
 * 邮箱初始化设置
 * @copyright     Copyright 2008-2010, PHInfo Services Inc. (http://www.phinfoservices.com)
 * @package       ues
 * @subpackage    ues/app/views/emails
 * @since         ues
 * @version       V0.0.1
 * @modifiedby    张海杰2011年0628
 * @lastmodified  张海杰2011年0705
 */
 -->

<?php
echo $html->css ( 'tab' );
echo $html->css ( 'style' );
echo $javascript->link('jquery-1.4.2');
echo $html->css('start/jquery-ui-1.8.2.custom');
echo $javascript->link('jquery-ui-1.8.2.custom.min');
echo $html->css ( 'jquery-validate/css/screen' );
echo $javascript->link ( 'jquery-validate/jquery.validate');
echo $javascript->link ( 'jquery-validate/additional-methods');
echo $javascript->link ( 'jquery-validate/localization/messages_cn');

?>

<script type="text/javascript">
//添加验证
$(document).ready(function() {
	$.validator.setDefaults({       
		 submitHandler: function(form) {    
		  form.submit();    
		}       
	});   
			
	$("#UesemailEditForm").validate({
		rules: {
			"data[Uesemail][mailboxServer]" :{
			required: true
			},//邮箱服务器
			"data[Uesemail][portNumber]" :{
				required: true,digits:true
				},//端口号
				"data[Uesemail][yourEmail]" :{
					required: true,email:true
					},//您的邮箱
					"data[Uesemail][username]" :{
						required: true,stringMinLength:0,stringMaxLength:50
						},//登录账号
						"data[Uesemail][password]" :{
							required: true,password:true,stringMinLength:3,stringMaxLength:50
							}//登录密码
		},
		messages:{maxitem:{required: "请输入"}},
		focusInvalid:false,
		onkeyup:false,
		errorPlacement:function(error, element){error.appendTo(element.parent());}
	});
});
//验证结束
</script>



<script type="text/javascript">
	function mycheck() {
		var EmailMailboxServer=$("#EmailMailboxServer").val();
		var EmailPortNumber=$("#EmailPortNumber").val();
		var EmailYourEmail=$("#EmailYourEmail").val();
		var EmailUsername=$("#EmailUsername").val();
		var EmailPassword=$("#EmailPassword").val();
		if($.trim(EmailMailboxServer)==""||$.trim(EmailPortNumber)==""||$.trim(EmailYourEmail)==""||$.trim(EmailUsername)==""||$.trim(EmailPassword)=="")
		{
			alert("请您认真填写");
			return false;
		}
		return true;	
	}
</script>
<!-- 当前位置-->
<div id="tabmenubar">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td class="tabmenubartitle1"><?php echo  __('YourPosition');//您现在的位置：?></td>
		<td class="tabmenubartitle2"><?php echo __('Personal Office');//一级目录
										   echo '>';?>
									<?php echo $html->tag('span', __('Email Add',true));//当前操作地用span加粗?> 						  
		</td>
	</tr>
</table>
</div>
<!-- 当前位置-->

<?php echo $form->create('Uesemail',array('action'=>'edit','type'=> 'post',"onsubmit"=>"return mycheck();"));?>
<?php echo $form->hidden('id',array('default'=>$email['Uesemail']['id']));?>
<div class="tabflex">
<fieldset><legend><?php __('Email Add');?></legend>
<table width="100%" cellspacing="0" cellpadding="0" border="0"
	style="text-align: left">
	<tr>
		<td width="100"></td>
		<td width="100"><?php __('Mailbox');?><font color="red">*</font></td>
		<td colspan="2"><?php echo $form->input('mailboxServer',array('default'=>$email['Uesemail']['mailboxServer'],'class' => 'TextBoxL txtOut','label'=>false,'id'=>'EmailMailboxServer'));?></td>
	</tr>
	<tr>
		<td width="100"></td>
		<td width="100"><?php __('email post');?><font color="red">*</font></td>
		<td width="150"><?php echo $form->input('portNumber',array('default'=>$email['Uesemail']['portNumber'],'class' => 'TextBoxL txtOut','label'=>false,'id'=>'EmailPortNumber'));?></td>

		<td width="">
       <?php 
       if($email['Uesemail']['isSslCheck']==0)
       {
       		echo $form->checkbox('isSslCheck', array('value' => '1'));
       }
       else
       {
       		echo $form->checkbox('isSslCheck', array('value' => '1','checked'=>true));
       }?>
       <?php __('isSSL');?></td>
	</tr>
	<tr>
		<td width="100"></td>
		<td width="100"><?php __('You email');?><font color="red">*</font></td>
		<td colspan="2"><?php echo $form->input('yourEmail',array('default'=>$email['Uesemail']['yourEmail'],'class' => 'TextBoxL txtOut','label'=>false,'id'=>'EmailYourEmail'));?></td>
	</tr>
	<tr>
		<td width="100"></td>
		<td width="100"><?php __('mailusername');?><font color="red">*</font></td>
		<td colspan="2"><?php echo $form->input('username',array('default'=>$email['Uesemail']['username'],'class' => 'TextBoxL txtOut','label'=>false,'id'=>'EmailUsername'));?></td>
	</tr>
	<tr>
		<td width="100"></td>
		<td width="100"><?php __('mailpassword');?><font color="red">*</font></td>
		<td colspan="2"><?php echo $form->input('password',array('default'=>$email['Uesemail']['password'],'class' => 'TextBoxL txtOut','label'=>false,'id'=>'EmailPassword'));?></td>
	</tr>
</table>
</fieldset>
		<table width="30%" cellspacing="0" cellpadding="0" border="0">
			<tr>
				<td width="100px"></td>
				<td width="100px">
				<?php echo $form->button('保存',array('type'=>'submit','class'=>'btn2'));?> 			
				<!-- __('Add', true)增加--></td>
				<td width="100px"><?php echo $form->button('取消',array('type'=>'reset','class'=>'btn2'));?>
				<!-- __('reset', true)取消--></td>
				<td></td>
			</tr>
		</table>
</div>	
<?php echo $form->end();?>
